<template>
    <span>
        <button @click="sub()">-</button>
        <span>{{num}}</span>
        <button @click="add()">+</button>
    </span>
</template>
<script>
export default {
    props:["num","index"],
    methods: {
        add(){
            this.$emit("add",this.index);
        },
        sub(){
            this.$emit("sub",this.index);
        }
    }
}
</script>